package com.ocom.devicehttp.client;


import com.ocom.common.constant.AiotUrl;
import com.ocom.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "aiot")
public interface AiotClientService {

    // 3.1.SaaS平台获取设备信息(getDeviceInfoBySaas)
    @GetMapping(AiotUrl.Url_GetDeviceInfoBySaas)
    public Result GetDeviceInfoBySaas(@RequestParam("saasNo")String saasNo,@RequestParam("agentId")Integer agentId,
                                      @RequestParam("comId")Integer comId,@RequestParam("deviceNo") String deviceNo);

    // 2.4.5.SaaS平台设置设备状态（SetDeviceStatus）
    @PostMapping(AiotUrl.Url_Aiot_SetDeviceStatus)
    public Result SetDeviceStatus(@RequestBody Map<String,Object> map);

    // 3.2.SaaS平台激活(禁用)设备(SetDeviceStatusBySaas)
    // 3.2.SaaS平台激活(禁用)消费设备(SetXfDeviceStatusBySaas)
    @PostMapping(AiotUrl.Url_Aiot_SetXfDeviceStatusBySaas)
    public Result SetXfDeviceStatusBySaas(@Validated @RequestBody Map<String,Object> map);


    @PostMapping(AiotUrl.URLP_AIOT_getOtaDeviceFlag)
    public Result getOtaUpdate(@RequestParam("deviceNo")String deviceNo,@RequestParam("appVer") String appVer);
}
